<?php

namespace app\admin\model\product;

use think\Model;


class Category extends Model
{





    // 表名
    protected $name = 'product_category';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];



    public function children()
    {
        return $this->hasMany(self::class, 'pid', 'id');
    }
    public function getCateImgAttr($value)
    {
        if($value){
            return request()->domain() . $value;
        }else{
            return $value;
        }


    }







}
